package com.biyeshengjiuye.service.impl;

import com.biyeshengjiuye.dao.EmploymentMapper;
import com.biyeshengjiuye.entity.Employment;
import com.biyeshengjiuye.service.EmploymentService;
import com.biyeshengjiuye.vo.EmplVo;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.Date;
import java.util.List;

@Service
@Transactional
public class EmploymentServiceImpl implements EmploymentService {

    @Resource
    private EmploymentMapper employmentMapper;



    public List<Employment> findEmploymentByPageById(EmplVo emplVo) {
        return employmentMapper.findEmploymentByPageById(emplVo);
    }


    public int addEmpl(Employment employment) {
        //保存创建时间
        employment.setCreatetime(new Date());
        return employmentMapper.addEmpl(employment);
    }

    public int updateEmpl(Employment employment) {
        return employmentMapper.updateEmpl(employment);
    }

    public int deleteById(Integer id) {
        return employmentMapper.deleteById(id);
    }

    public int getEmploymentCountByEnterpriseId(String e_id) {
        return employmentMapper.getEmploymentCountByEnterpriseId(e_id);
    }

    public List<Employment> findHotJobList(EmplVo emplVo) {
        return employmentMapper.findHotJobList(emplVo);
    }

    public List<Employment> findJobByPageById(EmplVo emplVo) {
        return employmentMapper.findJobByPageById(emplVo);
    }


}
